package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;
        import com.member.common.utils.DateUtils;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizGoodsRankMapper;
import com.member.shop.domain.SysBizGoodsRank;
import com.member.shop.service.ISysBizGoodsRankService;

/**
 * 商品榜单Service业务层处理
 *
 * @author lixinchen
 * @date 2025-01-11
 */
@Service
public class SysBizGoodsRankServiceImpl extends ServiceImpl<SysBizGoodsRankMapper, SysBizGoodsRank> implements ISysBizGoodsRankService
{
    @Resource
    private SysBizGoodsRankMapper sysBizGoodsRankMapper;

    /**
     * 查询商品榜单
     *
     * @param id 商品榜单主键
     * @return 商品榜单
     */
    @Override
    public SysBizGoodsRank selectSysBizGoodsRankById(Long id)
    {
        return sysBizGoodsRankMapper.selectById(id);
    }

    /**
     * 查询商品榜单列表
     *
     * @param queryWrapper 商品榜单
     * @return 商品榜单
     */
    @Override
    public List<SysBizGoodsRank> selectSysBizGoodsRankList(LambdaQueryWrapper<SysBizGoodsRank> queryWrapper)
    {
        return sysBizGoodsRankMapper.selectList(queryWrapper);
    }

    @Override
    public List<SysBizGoodsRank> selectSysBizGoodsRankList(SysBizGoodsRank sysBizGoodsRank) {
        return sysBizGoodsRankMapper.selectSysBizGoodsRankList(sysBizGoodsRank);
    }

    /**
     * 新增商品榜单
     *
     * @param sysBizGoodsRank 商品榜单
     * @return 结果
     */
    @Override
    public int insertSysBizGoodsRank(SysBizGoodsRank sysBizGoodsRank)
    {
                sysBizGoodsRank.setCreateTime(DateUtils.getNowDate());
            return sysBizGoodsRankMapper.insert(sysBizGoodsRank);
    }

    /**
     * 修改商品榜单
     *
     * @param sysBizGoodsRank 商品榜单
     * @return 结果
     */
    @Override
    public int updateSysBizGoodsRank(SysBizGoodsRank sysBizGoodsRank)
    {
                sysBizGoodsRank.setUpdateTime(DateUtils.getNowDate());
        return sysBizGoodsRankMapper.updateById(sysBizGoodsRank);
    }

    /**
     * 批量删除商品榜单
     *
     * @param ids 需要删除的商品榜单主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsRankByIds(Long[] ids)
    {
        return sysBizGoodsRankMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除商品榜单信息
     *
     * @param id 商品榜单主键
     * @return 结果
     */
    @Override
    public int deleteSysBizGoodsRankById(Long id)
    {
        return sysBizGoodsRankMapper.deleteById(id);
    }
}
